import http from '@/utils'

// 商机
class Niche {
    // 获取列表
    getList(reload) {
        let url = '/opportunity/index';
        return http.get(url, reload)
    }
    // 创建商机
    createContent(reload) {
      let url = '/opportunity/create';
      return http.post(url, reload)
    }
    // 编辑商机
    editContent(reload) {
      let url = '/opportunity/edit';
      return http.post(url, reload)
    }
    // 商机详情
    getContentDetail(reload) {
      let url = '/opportunity/detail';
      return http.get(url, reload)
    }
    // 删除
    deleteContent(reload) {
      let url = '/opportunity/delete';
      return http.post(url, reload)
    }
    // 更新
    updateOnlyfield(reload) {
      let url = '/opportunity/onlyfield';
      return http.post(url, reload)
    }
    // 列表上方状态
    getContractStatus(reload) {
      let url = '/opportunity/opportunity_status';
      return http.get(url, reload)
    }

    // 修改商机状态
    editStatus(reload) {
      let url = '/opportunity/update_status';
      return http.post(url, reload)
    }

    // 生成合同
    createContract(reload) {
      let url = '/opportunity/add_contract';
      return http.post(url, reload)
    }

    // 分派商机
    assignCustomer(reload) {
      let url = '/opportunity/allot';
      return http.post(url, reload)
    }
}

export default new Niche()